package com.pcbly.web.components.utils.converters;

import org.apache.commons.beanutils.Converter;
import org.apache.commons.beanutils.converters.FloatConverter;

public class MyFloatConverter implements Converter {

	private static Float newFloat()
    {
        return new Float(0.0F);
    }
	@SuppressWarnings("unchecked")
    public Object convert(Class type, Object value)
    {
        if(type.equals(Float.TYPE) && value == null)
            return newFloat();
        else
            return (new FloatConverter()).convert(type, value);
    }
    public MyFloatConverter(){
    	
    }

}
